Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snapshot): Change to ignore all link[rel="modulepreload"] (#228) #1614

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

billyvg
Copy link
Contributor

@billyvg billyvg commented Dec 17, 2024

... removes requirement to have as="script" attribute as it is optional (also modulepreload implies script).

Also fixes prefetch to extract file extension instead of checking end of string since there can be URL parameters.

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: ac9f15b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
rrweb-snapshot Patch
rrweb Patch
rrdom Patch
rrdom-nodejs Patch
rrweb-player Patch
@rrweb/all Patch
@rrweb/replay Patch
@rrweb/record Patch
@rrweb/types Patch
@rrweb/packer Patch
@rrweb/utils Patch
@rrweb/web-extension Patch
rrvideo Patch
@rrweb/rrweb-plugin-console-record Patch
@rrweb/rrweb-plugin-console-replay Patch
@rrweb/rrweb-plugin-sequential-id-record Patch
@rrweb/rrweb-plugin-sequential-id-replay Patch
@rrweb/rrweb-plugin-canvas-webrtc-record Patch
@rrweb/rrweb-plugin-canvas-webrtc-replay Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

) {
// ignore
} else if (
tagName === 'link' &&
n.attributes.rel === 'prefetch' &&
typeof n.attributes.href === 'string' &&
n.attributes.href.endsWith('.js')
extractFileExtension(n.attributes.href) === 'js'
Copy link
Contributor Author

@billyvg billyvg Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what is done in snapshot.ts

... removes requirement to have `as="script"` attribute. Also fixes
prefetch to extract file extension instead of checking end of string
since there can be URL parameters.
@billyvg billyvg force-pushed the fix-snapshot-link-modulepreload-ignore-all-up branch from 8a91047 to ac9f15b Compare January 20, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant